package com.social.socialservice.controller;

import com.social.socialservice.dal.FansDAL;
import com.social.socialservice.unit.Pager;
import com.social.socialservice.unit.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 粉丝用户相关请求API
 *
 */
@RestController
@CrossOrigin
public class FansController {
    @Autowired
    FansDAL fansDAL;

    /**
     * getUserListMapperDataByUserId
     * 根据用户id查询当前用户关注的用户分页数据
     */
    @RequestMapping(value = "/getFoUserListMapperDataByUserId", method = RequestMethod.POST, produces = "application/json; utf-8")
    public Response getFoUserListMapperDataByUserId(@RequestBody Pager pager){
        return fansDAL.getFoUserListMapperDataByUserId(pager);
    }

    /**
     * getFansUserListMapperDataByUserId
     * 根据用户id查询其粉丝的用户分页数据
     */
    @RequestMapping(value = "/getFansUserListMapperDataByUserId", method = RequestMethod.POST, produces = "application/json; utf-8")
    public Response getFansUserListMapperDataByUserId(@RequestBody Pager pager){
        return fansDAL.getFansUserListMapperDataByUserId(pager);
    }

    /**
     * getAuthFansUserListMapperDataByUserId
     * 已经认证的粉丝用户列表分页数据
     */
    @RequestMapping(value = "/getAuthFansUserListMapperDataByUserId", method = RequestMethod.POST, produces = "application/json; utf-8")
    public Response getAuthFansUserListMapperDataByUserId(@RequestBody Pager pager){
        return fansDAL.getAuthFansUserListMapperDataByUserId(pager);
    }

    /**
     * getYouKnowFoUserListMapperDataByUserId
     * 你认识的人：他关注的人，你也关注了
     * 通过用户id查询你认识的人
     * 参数：需要你要查询用户的id和当前用户id
     */
    @RequestMapping(value = "/getYouKnowFoUserListMapperDataByUserId", method = RequestMethod.POST, produces = "application/json; utf-8")
    public Response getYouKnowFoUserListMapperDataByUserId(@RequestBody Pager pager){
        return fansDAL.getYouKnowFoUserListMapperDataByUserId(pager);
    }
}
